package com.whg.demo.utils;

import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.apache.poi.xwpf.usermodel.XWPFParagraph;

import java.io.FileInputStream;
import java.io.FileNotFoundException;

/**
 * @Author whg
 * @create 2023/9/12 13:58
 * @description：
 */
public class ReplacePictureWord {

    public static void main(String[] args) throws FileNotFoundException, InvalidFormatException {
        XWPFDocument doc = new XWPFDocument();
        String imgPath = "D:\\home\\tonlan\\static\\printTemplate\\gz.png";
        String id = doc.addPictureData(new FileInputStream(imgPath),XWPFDocument.PICTURE_TYPE_PNG);
    }
}
